﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="tananyagkezeles.aspx.cs" Inherits="NEMProjectWebApp.Pages.Admin.tananyagkezeles" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2
        {
            width: 147px;
        }
        .style3
        {
            width: 496px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width: 100%;">
        <tr>
            <td class="style2">
                <asp:Label ID="Label1" runat="server" Text="Tárgy:"></asp:Label>
            </td>
            <td class="style3">
                <asp:DropDownList ID="TargyDropDownList" runat="server" Height="16px" Width="500px"
                    AutoPostBack="True" DataSourceID="SqlDataSource" DataTextField="TargyNeve" DataValueField="T_ID"
                    OnSelectedIndexChanged="TargyDropDownList_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                    SelectCommand="SELECT [TargyNeve], [T_ID] FROM [Targy]"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style2">
                <asp:Label ID="Label2" runat="server" Text="Új tananyagelérési utja:"></asp:Label>
            </td>
            <td class="style3">
                <asp:FileUpload ID="FileUpload1" runat="server" Width="496px" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;
            </td>
            <td class="style3">
                <asp:Button ID="TanAnyagFeltoltButton" runat="server" Text="Tananyag feltöltése"
                    Width="500px" OnClick="TanAnyagFeltoltButton_Click" />
            </td>
        </tr>
    </table>
    <asp:Label ID="Label3" runat="server" Text="Tárgy tananyagai:"></asp:Label>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ListBox ID="TananyagListBox" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
                DataTextField="FileName" DataValueField="Tan_ID" OnSelectedIndexChanged="TananyagListBox_SelectedIndexChanged"
                Width="719px"></asp:ListBox>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                SelectCommand="select [FileName], TananyagKapcs.Tan_ID FROM [TananyagKapcs],[Tananyag]  WHERE Targy_ID = @Targy_ID AND Tananyag.Tan_ID = TananyagKapcs.Tan_ID">
                <SelectParameters>
                    <asp:ControlParameter ControlID="TargyDropDownList" Name="Targy_ID" PropertyName="SelectedValue" />
                </SelectParameters>
            </asp:SqlDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <br />
    <asp:Button ID="TorlesBtn" runat="server" Text="Törlés" Width="100px" OnClick="TorlesBtn_Click" />
</asp:Content>
